package czy.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@EnableWebMvc
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    /* 静态资源路径 */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /* swagger资源在/META-INF/resources/下
         * 自有资源在/static下
          * */
        registry.addResourceHandler("/**") .addResourceLocations("classpath:/static/","classpath:/META-INF/resources/");
    }

}
